package cn.sofwin.project.src.entity;

import java.util.Scanner;

// 移动卡
public class MobileCard {
    Scanner sc = new Scanner(System.in);
    // 卡号
    public String cardNumber = "";
    // 用户姓名
    public String userName = "";
    // 密码
    public String passWord = "";
    // 使用的套餐
    public ServicePackage setPackage;
    // 套餐外消费金额
    public double consumAmount = 0.00;
    // 余额
    public double money = 0.00;
    // 通话时间
    public int realTalkTime = 0;
    // 短信数量
    public int realSMSCCount = 0;
    // 流量
    public double realFlow = 0;

    // 显示信息
    public void showMeg(){
        System.out.println(" 卡号：" + cardNumber + " 用户名：" + userName + " 当前余额：" + money);
        if (setPackage.price == 58)
            System.out.println("话唠套餐：通话时长为200分钟/月，短信条数为60条/月，资费为58元/月。");
        else if (setPackage.price == 68)
            System.out.println("网虫套餐：上网流量为5GB/月，资费为68元/月。");
        else if (setPackage.price == 78)
            System.out.println("超人套餐：通话时长为200分钟/月，短信条数为100条/月，上网流量为1GB/月，资费为78元/月。");
    }

    public MobileCard(){
        System.out.print("1.话唠套餐\t2.网虫套餐\t3.超人套餐，\t请选择套餐（输入序号）：");
        switch (sc.nextInt()){
            case 1:
                setPackage = new TalkPackage();
                setPackage.price = 58;
                break;
            case 2:
                setPackage = new NetPackage();
                setPackage.price = 68;
                break;
            case 3:
                setPackage = new SuperPackage();
                setPackage.price = 78;
                break;
            default:
                System.out.println("输入有误");
                return;
        }
        System.out.print("请输入姓名：");
        userName = sc.next();
        System.out.print("请输入密码：");
        passWord = sc.next();
        System.out.print("请输入预存话费金额：");
        money = sc.nextDouble();
        money -= setPackage.price;
    }
}
